package com.ysd.lis.controller.qc;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.qc.QcMaterialItem;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.service.qc.QcMaterialItemTargetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author pengrongshuai
 * @since 2023-12-26
 */
@Api(tags = "质控品项目")
@RestController
@RequestMapping("/api/qc/qcMaterialItemTarget")
public class QcMaterialItemTargetController extends BaseController {

    @Autowired
    QcMaterialItemTargetService qcMaterialItemTargetService;

    @ApiOperation("查询")
    @GetMapping("/findMaterialTargetList")
    public Result findMaterialTargetList(CommonPageDto pageParam){
        return qcMaterialItemTargetService.findMaterialTargetList(pageParam);
    }

    @ApiOperation("修改")
    @PostMapping("/saveOrUpdateMaterialTarget")
    @LogDetail(requestParam ="saveOrUpdateMaterialTarget",operationType = OperationType.INSERT, module = "质控靶值设定",content = "批量更新靶值", businessName = "name")
    public Result saveOrUpdateMaterialTarget(@RequestBody QcMaterialItem item) {
        return qcMaterialItemTargetService.saveOrUpdateMaterialTarget(item);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteMaterialTargetList")
    @LogDetail(requestParam ="deleteIntf",operationType = OperationType.DELETE, module = "质控靶值设定",content = "批量删除质控靶值")
    public Result batchDeleteMaterialTargetList(@RequestBody QcMaterialItem dto){
        return  qcMaterialItemTargetService.batchDeleteMaterialTargetList(dto);
    }

}
